# Dust theme
# by Rico Sta. Cruz and Ricardo (Kido) Mariano III
# Last rev: Sept 13

# Set GtkSettings color scheme property.
# This can be overriden (via an xsetting) with eg. the gnome-appearance-properties.
gtk_color_scheme = "fg_color:#323232\nbg_color:#e4e0d8\nbase_color:#fff\ntext_color:#323232\nselected_bg_color:#996B5C\nselected_fg_color:#fff\ntooltip_bg_color:#ebeab8\ntooltip_fg_color:#323232"

style "aurora-default"
{

	########
	# Style Properties
	########
	 GtkButton::default_border = { 0, 0, 0, 0 }
	  GtkButton::child-displacement-x = 0
	  GtkButton::child-displacement-y = 1
	  #GtkWidget::focus-padding = 0

	  GtkRange::trough-border = 0
	  GtkRange::slider-width = 17
	  GtkRange::stepper-size = 15

	  GtkScrollbar::min_slider_length = 36
	  GtkScrollbar::has-secondary-backward-stepper = 0
	  
	  GtkScrolledWindow ::scrollbars-within-bevel = 1
	  GtkScrolledWindow ::scrollbar-spacing = 0

	  GtkPaned::handle_size  = 8

	  GtkMenuBar::internal-padding  = 0
	  GtkTreeView::expander_size     = 13 #15
	  GtkExpander::expander_size     = 13 #17
	  
	  GtkScale::slider-length = 25
	  GtkScale::slider-width  = 17
	  GtkScale::trough-border = 0

	  GtkWidget::link-color = "#0062dc" # blue
	  GtkWidget::visited-link-color = "#8c00dc" #purple

	  WnckTasklist::fade-overlay-rect = 0
	  WnckTasklist::fade-loop-time = 5.0 # 5 seconds
	  WnckTasklist::fade-opacity = 0.5 # final opacity

	  #makes menu only overlap border
	  GtkMenu::horizontal-offset = -1

	  #removes extra padding at top and bottom of menus.  Makes menuitem overlap border
	  GtkMenu::vertical-padding = 0

	  #set to the same as roundness, used for better hotspot selection of tabs
	  GtkNotebook::tab-curvature = 3
	  GtkNotebook::tab-overlap = 5

	  GtkMenuItem::arrow-spacing = 10
	  #Spacing between edge with indicator and text
	  GtkOptionMenu  ::indicator-size = {11, 5}
	  #GtkOptionMenu  ::indicator-spacing = {6, 5, 4, 4}

	  GtkCheckButton ::indicator-size = 15
	  GtkCheckButton ::indicator-spacing = 1
	  GtkRadioButton ::indicator-size = 15

	  GtkTreeView::horizontal_separator = 2
	  GtkTreeView::odd_row_color = mix(0.98, shade (0.93, @base_color), @selected_bg_color)

	  GtkScrolledWindow::scrollbar-spacing = 0
	  GtkScrolledWindow::scrollbars-within-bevel = 1

	xthickness = 1
	ythickness = 1


	fg[NORMAL]        = @fg_color
	fg[PRELIGHT]      = @fg_color
	fg[SELECTED]      = @selected_fg_color
	fg[ACTIVE]        = @fg_color
	fg[INSENSITIVE]   = darker (@bg_color)

	bg[NORMAL]        = @bg_color
	bg[PRELIGHT]      = shade (1.02, @bg_color)
	bg[SELECTED]	  = @selected_bg_color
	bg[INSENSITIVE]   = @bg_color
	bg[ACTIVE]        = shade (0.9, @bg_color)

	base[NORMAL]      = @base_color
	base[PRELIGHT]    = shade (0.95, @bg_color)
	base[ACTIVE]      = shade (0.9, @selected_bg_color)
	base[SELECTED]    = @selected_bg_color
	base[INSENSITIVE] = @bg_color

	text[NORMAL]      = @text_color
	text[PRELIGHT]    = @text_color
	text[ACTIVE]      = @selected_fg_color
	text[SELECTED]    = @selected_fg_color
	text[INSENSITIVE] = darker (@bg_color)

	engine "aurora" 
	{
		menubarstyle    = 1 # 0 = flat, 1 = gradient, 2 = sunken
	  	curvature       = 2.0
		arrowsize       = 0.5 # controls combo_arrow circle size.  Diameter set by (11 + 2 * arrowsize)
		old_arrowstyle  = FALSE #set to TRUE for original circled arrows
		animation       = TRUE # FALSE = disabled, TRUE = enabled
	}
}

style "aurora-wide"
{
	xthickness = 2
	ythickness = 2
}

style "aurora-wider"
{
	xthickness = 3
	ythickness = 3
}

style "aurora-dark"
{
	bg[NORMAL] =  shade(0.25,@bg_color)
	bg[PRELIGHT] =  mix (0.3, @selected_bg_color, shade(0.2,@bg_color))
	bg[SELECTED] =  mix (0.3, @selected_bg_color, shade(0.2,@bg_color))
	bg[ACTIVE] =  mix (0.1, @selected_bg_color, shade(0.2,@bg_color))
	bg[INSENSITIVE] =  shade(0.2,@bg_color)
	
	fg[NORMAL] = mix (0.7,  '#ffffef', @fg_color)
	fg[PRELIGHT] = mix (0.8,  '#ffffef', @fg_color)
	fg[SELECTED] = mix (0.8,  '#ffffef', @fg_color)
	fg[ACTIVE] = mix (0.8,  '#ffffef', @fg_color)
	fg[INSENSITIVE] = mix (0.4,  '#ffffef', @fg_color)
	
}


style "aurora-button"
{
	xthickness   = 3
	ythickness   = 3

	bg[NORMAL]   = shade (1.2, @bg_color)
	bg[PRELIGHT] = shade (1.0, @bg_color) #mix(0.82,shade (1.3, @bg_color),@selected_bg_color)
	bg[ACTIVE]   = shade (0.85, @bg_color)
	
	engine "aurora"{
		contrast = 1.5
	}
}


style "aurora-toolbar" = "aurora-dark"
{
	bg[NORMAL] =  mix (0.1, @selected_bg_color, shade(0.2,@bg_color))
	bg[PRELIGHT] =  mix (0.3, @selected_bg_color, shade(0.2,@bg_color))
	bg[SELECTED] =  mix (0.3, @selected_bg_color, shade(0.2,@bg_color))
	bg[ACTIVE] =  mix (0.5, @selected_bg_color, shade(0.2,@bg_color))
	bg[INSENSITIVE] =  shade(0.2,@bg_color)
	
}


style "pixmap-toolbar" = "aurora-toolbar"
{
	bg[NORMAL] =  mix (0.02, @selected_bg_color, shade(0.22,@bg_color))
	bg[PRELIGHT] =  mix (0.3, @selected_bg_color, shade(0.22,@bg_color))
	bg[SELECTED] =  mix (0.3, @selected_bg_color, shade(0.22,@bg_color))
	bg[ACTIVE] =  mix (0.1, @selected_bg_color, shade(0.22,@bg_color))
	bg[INSENSITIVE] =  shade(0.2,@bg_color)
	
	# To-do: make the toolbar recolorable, possibly without using pixmaps
	# We only like this because of the top line, anyway.
	engine "pixmap"{
		image {
	  		function = BOX
	  		file = "toolbar_o.png"
	  		border = {1,1,1,1}
	  	}
	  	#To-do: handlebox image or find a different way to do this
	  	image
		{
		      function				= HANDLE
		      overlay_file			= "blank.png"
		      overlay_stretch 	= FALSE
		      orientation			= HORIZONTAL
    		}
    		image
		{
		      function				= HANDLE
		      overlay_file			= "blank.png"
		      overlay_stretch 	= FALSE
		      orientation			= VERTICAL
    		}
	}
}

style "aurora-notebook-bg" = "aurora-wider"
{
	bg[NORMAL] = shade (1.05, @bg_color)
	bg[SELECTED]   = shade (1.05, @bg_color)
}

style "aurora-notebook" = "aurora-notebook-bg"
{
	
}

style "aurora-tasklist"
{
	xthickness = 3
	ythickness = 3
}

style "aurora-panel" = "aurora-dark"{
}

style "aurora-menu" = "aurora-dark"
{
	xthickness = 0
	ythickness = 2

	bg[NORMAL] = shade (0.15, @bg_color)

}

style "aurora-menu-item" = "aurora-dark"
{
	xthickness = 0
	ythickness = 3
	
	fg[PRELIGHT] = @selected_fg_color  # Color of selected menu item text.
	bg[SELECTED]    = shade(0.9,@selected_bg_color)  # Color of menu items.
	bg[PRELIGHT]    = shade (0.9, @selected_bg_color)  # Color of menu items.
	fg[NORMAL] =    shade (0.9, @bg_color) # RSC: Menu item color
	fg[INSENSITIVE] = shade (0.25, @bg_color) # RSC: Disabled menu item
	

}

style "aurora-separator-menu-item"
{
	GtkSeparatorMenuItem::horizontal-padding = 0
	# We are setting the desired height by using wide-separators
	# There is no other way to get the odd height ...
	GtkWidget::wide-separators = 1
	GtkWidget::separator-width = 1
	GtkWidget::separator-height = 1
	xthickness = 1
	ythickness = 0
}

style "aurora-treeview"
{
	engine "aurora" {
		#hint = "treeview"
		#contrast = 1.0
	}
}

# Based on the default style so that the colors from the button
# style are overriden again.
style "aurora-treeview-header" = "aurora-default"
{
	xthickness = 2
	ythickness = 1

}


style "aurora-tooltips"
{
	xthickness = 4
	ythickness = 4

	bg[NORMAL] = @tooltip_bg_color
	fg[NORMAL] = @tooltip_fg_color
}

style "aurora-progressbar"
{
	xthickness = 1
	ythickness = 1

	fg[PRELIGHT] = @selected_fg_color

}

style "aurora-statusbar" = "aurora-default"
{
	ythickness = 3
	xthickness = 3
	bg[NORMAL] = @bg_color
}

style "aurora-comboboxentry" 
{
}

style "aurora-spinbutton"
{
}

style "aurora-scale" = "aurora-default"
{
}

style "aurora-hscale" = "aurora-scale"
{
}

style "aurora-vscale" = "aurora-scale"
{
}


style "aurora-scrollbar"
{
	bg[ACTIVE] = "#fff"
	bg[NORMAL] = darker(@bg_color)
}

style "aurora-hscrollbar" = "aurora-scrollbar"
{
}

style "aurora-vscrollbar" = "aurora-scrollbar"
{
}

style "pixmap-menubar" = "aurora-dark"
{
	engine "pixmap"{
		image {
	  		function = BOX
	  		file = "menubar.png"
	  		border = {1,1,1,1}
	  	}
	}
}

style "aurora-frame"
{
	
	bg[ACTIVE] = shade(0.2,@bg_color)
	fg[NORMAL] = mix (1.5, @fg_color, '#ffffff')
	fg[PRELIGHT] = mix (1.4, @fg_color, '#ffffff')
}

style "aurora-frame-title" = "aurora-frame"
{
	fg[NORMAL] = lighter (@fg_color)
}

style "aurora-nautilus-location"
{
	bg[NORMAL] = mix(0.60, shade (1.05,@bg_color), @selected_bg_color)
}




#########################################
# Matches
#########################################

# aurora default style is applied to every widget
class "GtkWidget"    style "aurora-default"

# Increase the x/ythickness in some widgets
class "GtkRange"     style "aurora-default"
class "GtkFrame"     style "aurora-frame"
class "GtkSeparator" style "aurora-wide"
class "GtkEntry"     style "aurora-wider"
class "GtkStatusbar" style "aurora-statusbar"
class "GtkToolbar"   style "pixmap-toolbar" 
class "GtkMenuBar"   style "pixmap-menubar"

# RSC: Handle box fix
class "*HandleBox" style "pixmap-toolbar"
widget_class "*HandleBox" style "pixmap-toolbar"

class "GtkSpinButton"  style "aurora-spinbutton"
class "GtkScale"       style "aurora-scale"
class "GtkVScale"      style "aurora-vscale"
class "GtkHScale"      style "aurora-hscale"
class "GtkScrollbar"   style "aurora-scrollbar"
class "GtkVScrollbar"  style "aurora-vscrollbar"
class "GtkHScrollbar"  style "aurora-hscrollbar"

# General matching following, the order is choosen so that the right styles override each other
# eg. progressbar needs to be more important then the menu match.

# This is not perfect, it could be done better
# (That is modify *every* widget in the notebook, and change those back that
# we really don't want changed)
widget_class "*<GtkNotebook>*<GtkEventBox>"     style "aurora-notebook-bg"
widget_class "*<GtkNotebook>*<GtkDrawingArea>"  style "aurora-notebook-bg"
widget_class "*<GtkNotebook>*<GtkLayout>"       style "aurora-notebook-bg"

widget_class "*<GtkButton>"      style "aurora-button"
widget_class "*<GtkNotebook>"    style "aurora-notebook"

widget_class "*<GtkComboBoxEntry>*" style "aurora-comboboxentry"
widget_class "*<GtkCombo>*"         style "aurora-comboboxentry"

widget_class "*<GtkMenu>*"              style "aurora-menu"
widget_class "*<GtkMenuItem>*"          style "aurora-menu-item"
widget_class "*<GtkSeparatorMenuItem>*" style "aurora-separator-menu-item"

widget_class "*<GtkFrame>"  style "aurora-frame"
widget_class "*.<GtkFrame>.<GtkLabel>" style "aurora-frame-title"
widget_class "*.<GtkTreeView>*"        style "aurora-treeview"

widget_class "*<GtkStatusbar>*"  style "aurora-statusbar"
widget_class "*<GtkProgressBar>"       style "aurora-progressbar"

# Treeview header
widget_class "*.<GtkTreeView>.<GtkButton>" style "aurora-treeview-header"
widget_class "*.<GtkCTree>.<GtkButton>"    style "aurora-treeview-header"
widget_class "*.<GtkList>.<GtkButton>"     style "aurora-treeview-header"
widget_class "*.<GtkCList>.<GtkButton>"    style "aurora-treeview-header"

widget_class "*<GtkToolbar>.*"   style "aurora-toolbar"

#Panel
widget "*PanelWidget*" 					style "aurora-panel"
widget "*PanelApplet*" 					style "aurora-panel"
widget "*fast-user-switch*"				style "aurora-panel" # Workaround for Fast User Switch applet
class "PanelApp*" 					style "aurora-panel"
class "PanelToplevel*" 					style "aurora-panel"


#KM: The panel menubar
widget_class "*Panel*<GtkMenuBar>*"           		style "aurora-default"

# The window of the tooltip is called "gtk-tooltip"
################################
# FIXME:
# This will not work if one embeds eg. a button into the tooltip.
# As far as I can tell right now we will need to rework the theme
# quite a bit to get this working correctly.
# (It will involve setting different priorities, etc.)
################################
widget "gtk-tooltip*" style "aurora-tooltips"

###################################################
# Special cases and work arounds
###################################################

# Workarounds for Evolution
widget_class "*.ETable.ECanvas"    style "aurora-treeview-header"
widget_class "*.ETree.ECanvas"    style "aurora-treeview-header"

#Firefox isn't nice to dark themes, so unset the dark stuff.
widget "MozillaGtkWidget*Toolbar*"	style "aurora-default"
widget "MozillaGtkWidget*Frame*"	style "aurora-default"

#Thunderbird too. But since Thunderbird uses the same theming engine as FF2, things are worse for us.


# Special case the nautilus-extra-view-widget
# ToDo: A more generic approach for all applications that have a widget like this.
widget "*.nautilus-extra-view-widget" style : highest "aurora-nautilus-location"

# Work around for http://bugzilla.gnome.org/show_bug.cgi?id=382646
# Note that the work around assumes that the combobox is _not_ in
# appears-as-list mode.
# Similar hack also in the menuitem style.
# This style does not affect GtkComboBoxEntry, it does have an effect
# on comboboxes in appears-as-list mode though.
style "aurora-text-is-fg-color-workaround"
{
	text[NORMAL]      = @fg_color
	text[PRELIGHT]    = @fg_color
	text[SELECTED]    = @selected_fg_color
	text[ACTIVE]      = @fg_color
	text[INSENSITIVE] = darker (@bg_color)
}
widget_class "*.<GtkComboBox>.<GtkCellView>"   style "aurora-text-is-fg-color-workaround"

style "aurora-text-is-fg-color-workaround-dark"
{
	#Make it work with this theme!
	text[NORMAL] = mix (1.5, @fg_color, '#ffffff')
	text[PRELIGHT] = mix (1.4, @fg_color, '#ffffff')
}
widget_class "*Toolbar*.<GtkComboBox>.<GtkCellView>"   style "aurora-text-is-fg-color-workaround-dark"

style "aurora-menuitem-text-is-fg-color-workaround" 
{
	#text[NORMAL]        = @fg_color
	#text[PRELIGHT]      = @selected_fg_color
	#text[SELECTED]      = @selected_fg_color
	#text[ACTIVE]        = @fg_color
	#text[INSENSITIVE]   = darker (@bg_color)
	#Make it work with this theme!
	text[NORMAL] = mix (1.5, @fg_color, '#ffffff')
	text[PRELIGHT] = mix (1.4, @fg_color, '#ffffff')
}
widget "*.gtk-combobox-popup-menu.*"   style "aurora-menuitem-text-is-fg-color-workaround"

# Work around the usage of GtkLabel inside GtkListItems to display text.
# This breaks because the label is shown on a background that is based on the
# base color set.
style "aurora-fg-is-text-color-workaround"
{
	fg[NORMAL]      = @text_color
	fg[PRELIGHT]    = @text_color
	fg[ACTIVE]      = @selected_fg_color
	fg[SELECTED]    = @selected_fg_color
	fg[INSENSITIVE] = darker (@bg_color)
}
widget_class "*<GtkListItem>*" style "aurora-fg-is-text-color-workaround"
# The same problem also exists for GtkCList and GtkCTree
# Only match GtkCList and not the parent widgets, because that would also change the headers.
widget_class "*<GtkCList>" style "aurora-fg-is-text-color-workaround"

style "aurora-evo-new-button-workaround" = "aurora-dark"
{

	engine "aurora"
	{
		toolbarstyle = 0
	}
}

widget_class "EShellWindow.GtkVBox.BonoboDock.BonoboDockBand.BonoboDockItem*" style "aurora-evo-new-button-workaround"

